# 10.5
from pathlib import Path

path = Path('day15/guest_book.txt')
prompt = "Hi,what's your name? "
prompt += "\nEnter 'quit' if you're the last guest."

guest_name = []

while True:
    name = input(prompt)
    if name == 'quit':
        break
    guest_name.append(name)

#print(guest_name)              # ['zhangsan', 'lisi', 'wangwu']

name_string = ''

for name in guest_name:
    name_string += (f"{name}\n")

path.write_text(name_string)
